LayoutDXL: Update new COlumn according to another column

Hi All,
Lets say tat we have a column "ColumnA" and it is an enum {A1, A2, A3, etc}.
And we want to update "ColumnB", which is a LayoutDXL, according to "ColumnA"'s value. Such as for A1 we want ColumnB to be "B is perfect" and for the rest "B is Not perfect".

Here what I tried:

if( (richText co."ColumnA") == (richText "A1"))
{
    display "B is perfect"
}
else
{
 
        display "B is NOT perfect"
}

 


This code simply updates all cells of the ColumnB according to current object's ColumnA value.
However, what I want is to update the ColumnB according to corresponding ColumnA value. Apparently, I shouldn't use current object, but what should I use?

Thanks

 


RayTTT - Tue Jan 11 05:06:28 EST 2011

Re: LayoutDXL: Update new COlumn according to another column
Peter_Albert - Tue Jan 11 05:38:59 EST 2011

In layout DXL context, the variable 'obj' is pre-declared to each respective object. Just try

display obj."Object Text"

to see how it works.

Regards,

Peter

Re: LayoutDXL: Update new COlumn according to another column
Mathias Mamsch - Tue Jan 11 05:41:57 EST 2011

DXL defines the "obj" variable (Type: Object) in a DXL layout column, which is the Object for which the layout is currently calculated. And you probably do not need to compare richtext, do you? So it should be:
 

// to compare the attribute value you can use   obj."attrName" "" (to cast to a string) 
if( obj."ColumnA" "" ==  "A1")
    display "B is perfect"
else    
    display "B is NOT perfect"

 


Hope that helps, regards, Mathias

 

 


Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS

 

Re: LayoutDXL: Update new COlumn according to another column
RayTTT - Tue Jan 11 05:58:24 EST 2011

Peter_Albert - Tue Jan 11 05:38:59 EST 2011

In layout DXL context, the variable 'obj' is pre-declared to each respective object. Just try

display obj."Object Text"

to see how it works.

Regards,

Peter

Thank you Peter it works now :)

And may I ask one more question, when distirbuting the module as partion, do I have to give LayoutDXL script also, or does the partioning process automatically include the script?

Re: LayoutDXL: Update new COlumn according to another column
RayTTT - Tue Jan 11 05:58:51 EST 2011

RayTTT - Tue Jan 11 05:58:24 EST 2011
Thank you Peter it works now :)

And may I ask one more question, when distirbuting the module as partion, do I have to give LayoutDXL script also, or does the partioning process automatically include the script?

Also I thank you Mathias :)

Re: LayoutDXL: Update new COlumn according to another column
Peter_Albert - Tue Jan 11 06:49:54 EST 2011

RayTTT - Tue Jan 11 05:58:24 EST 2011
Thank you Peter it works now :)

And may I ask one more question, when distirbuting the module as partion, do I have to give LayoutDXL script also, or does the partioning process automatically include the script?

From the DOORS help: "By default, the partition includes all the views for each of the modules you add to the partition.", so any layout DXL will be included in the partition.

If you #include a script from your local filesystem in the layout DXL, then of course you will have to provide the script as well, and ensure that the relative path is identical in the home and away database.

Regards,

Peter

Re: LayoutDXL: Update new COlumn according to another column
RayTTT - Tue Jan 11 07:27:26 EST 2011

Peter_Albert - Tue Jan 11 06:49:54 EST 2011
From the DOORS help: "By default, the partition includes all the views for each of the modules you add to the partition.", so any layout DXL will be included in the partition.

If you #include a script from your local filesystem in the layout DXL, then of course you will have to provide the script as well, and ensure that the relative path is identical in the home and away database.

Regards,

Peter

Ok, thank you.

Bes regards